package vip.meeet.start;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import vip.meeet.bean.LifeCycleBean;
import vip.meeet.config.SpringLifeCycleConfig;

public class LifeCycleStart {

    public static void main(String[] args) {
        xml();
//        config();
    }

    public static void config(){
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(SpringLifeCycleConfig.class);
        context.getBean(LifeCycleBean.class);
        context.removeBeanDefinition("lifeCycleBean");

    }

    public static void xml(){
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("spring-application.xml");
        context.getBean(LifeCycleBean.class);
        context.close();
    }
}
